package com.example.myapplication.room;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;

import java.util.List;

public class RequestCollectViewModel extends AndroidViewModel{

    public static Application application;

    public RequestCollectViewModel(@NonNull Application application) {
        super(application);
        this.application = application;
    }

    public static LiveData<List<Student>> getStudentsLive() {
        return LocaRoomRequestManager.getInstance(application).getStudentLive();
    }

    public void touchoffInsertStudents(Student... students) {
        LocaRoomRequestManager.getInstance(application).insertStudents(students);
    }

    public void touchoffUpdateStudents(Student... students) {
        LocaRoomRequestManager.getInstance(application).updateStudents(students);
    }

    public void touchoffDeleteStudents(Student... students) {
        LocaRoomRequestManager.getInstance(application).deleteStudents(students);
    }

    public void touchoffdeleteAllStudents() {
        LocaRoomRequestManager.getInstance(application).deleteAllStudents();
    }


}
